﻿using TaoSH.AppCode;
using TaoSH.Data;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace TaoSH.View
{
    public partial class XTGG : FormUControl
    {




        #region//添加页面

        public override void initAddForm(string strFormCode)
        {
            conZDSDate.Value = DateTime.Now.ToString("yyyy-MM-dd");
            conZDEDate.Value = DateTime.Now.AddDays(7).ToString("yyyy-MM-dd");
        }




        /// <summary>
        /// 送审表单
        /// </summary>
        /// <param name="FormID">表单号</param>
        /// <param name="intProcessInstanceID">流程号</param>
        /// <returns></returns>
        public override bool SaveForm(int intFormID, string strActionType)
        {
            ZH_XTGG MODEL = new ZH_XTGG();
            MODEL = new ZH_XTGGB().GetEntity(d => d.ID == intFormID);
            MODEL.GGTitle = conGGTitle.Text;
            MODEL.remark = conISZY.SelectedValue;
            MODEL.remark1 = hidRY.Value;
            MODEL.remark2 = conRY.Text;
            MODEL.ZDSTime = DateTime.Parse(conZDSDate.Value);
            MODEL.ZDETime = DateTime.Parse(conZDEDate.Value);
            MODEL.GGContent = conGGContent.Value;


            return new ZH_XTGGB().Update(MODEL);
        }
        #endregion

        #region//查看页面
        /// <summary>
        /// 初始化View页面
        /// </summary>
        /// <param name="intFormID">表单号</param>
        public override void initMangerForm(int intFormID)
        {
            ZH_XTGG MODEL = new ZH_XTGG();
            MODEL = new ZH_XTGGB().GetEntity(d => d.ID == intFormID);
            conGGTitle.Text = MODEL.GGTitle;
            conZDSDate.Value = DateTime.Parse(MODEL.ZDSTime.ToString()).ToString("yyyy-MM-dd");
            conZDEDate.Value = DateTime.Parse(MODEL.ZDETime.ToString()).ToString("yyyy-MM-dd");
            conGGContent.Value = MODEL.GGContent;
            conISZY.SelectedValue = MODEL.remark;
            hidRY.Value = MODEL.remark1;
            conRY.Text = MODEL.remark2;
        }

        #endregion





    }
}